package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String mean;

    public ShopController() {
        System.out.println("1.通过构造方法实例化");
    }
    @Value("商城")
    public void setMean(String mean) {
        this.mean = mean;
        System.out.println("2.属性赋值");
    }
    @PostConstruct
    public void Init(){
        System.out.println("3.初始化");

    }
    @PreDestroy
    public void destroy(){
        System.out.println("5.销毁");
    }
}
